Method for gating an output of a single photon avalanche diode (SPAD) cluster based on an ambient count of ambient light events generated by the SPAD cluster in a region of interest of a time of flight (TOF) ranging array

ABSTRACT

In an embodiments, a method for operating a time-of-flight (ToF) ranging array includes: illuminating a field-of-view (FoV) of the ToF ranging array with radiation pulses; receiving reflected radiation pulses with a plurality of single photon avalanche diodes (SPADs) in a region of interest (ROI) of the ToF ranging array, the plurality of SPADs arranged in a plurality of SPAD clusters; determining an ambient count of ambient light events generated by SPADs of a first SPAD cluster of the plurality of SPAD clusters; and gating an output of the first SPAD cluster based on the ambient count.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/722,923, filed on Dec. 20, 2019, which application is herebyincorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates generally to an electronic system andmethod, and, in particular embodiments, to a method for operating atime-of-flight (ToF) ranging array, corresponding circuit and device.

BACKGROUND

Devices for determining the distance (range) to objects (targets) areknown. One currently used method is called time-of-flight (ToF). Thismethod comprises sending a light signal towards the object and measuringthe time taken by the signal to travel to the object and back. Thecalculation of the time taken by the signal for this travel may beobtained by measuring the phase shift between the signal coming out ofthe light source and the signal reflected from the object and detectedby a light sensor. Knowing this phase shift and the speed of lightenables the determination of the distance to the object.

Single photon avalanche diodes (SPADs) may be used as a detector ofreflected light. In general, an array of SPADs is used as a sensor inorder to detect a reflected light pulse. A photon may generate a carrierin the SPAD through the photo electric effect. The photo generatedcarrier may trigger an avalanche current in one or more of the SPADs ina SPAD array. The avalanche current may signal an event, namely that aphoton of light has been detected.

Light detection and ranging (LIDAR), also called LADAR, is anapplication that uses ToF techniques to detect the presence of objectsand its associated distance from a source.

A proximity sensor may benefit from ToF techniques. Proximity sensorsdetect the presence of nearby objects without physical contact.

Another application that may benefit from ToF techniques is autofocus(AF) for cameras.

SUMMARY

In accordance with an embodiment, a method for operating atime-of-flight (ToF) ranging array, the method including: illuminating afield-of-view (FoV) of the ToF ranging array with radiation pulses;receiving reflected radiation pulses with a plurality of single photonavalanche diodes (SPADs) in a region of interest (ROI) of the ToFranging array, the plurality of SPADs arranged in a plurality of SPADclusters; determining an ambient count of ambient light events generatedby SPADs of a first SPAD cluster of the plurality of SPAD clusters; andgating an output of the first SPAD cluster based on the ambient count.

In accordance with an embodiment, a ranging circuit including: aplurality of single photon avalanche diode (SPAD) macro-blocks (MBs),each SPAD MB including a respective SPAD cluster and a respective ORtree; a controller coupled to an output of the respective OR tree ofeach SPAD MB of the plurality of SPAD MBs; and a processor configured togenerate a histogram based on an output of one or more SPAD MBs of theplurality of SPAD MBs, where the controller is configured to: determinean ambient count of ambient light events generated by SPADs of a firstSPAD cluster of a first SPAD MB of the plurality of SPAD MBs; and gatean output of the first SPAD MB based on the ambient count.

In accordance with an embodiment, a device including: an illuminatorcircuit configured to illuminate a field-of-view (FoV) of the devicewith radiation pulses; a time-of-flight (ToF) ranging array including aplurality of single photon avalanche diode (SPAD) macro-blocks (MBs),each SPAD MB including a respective SPAD cluster and a respective ORtree, the ToF ranging array configured to receive reflected radiationpulses; a controller coupled to an output of the respective OR tree ofeach SPAD MB of the plurality of SPAD MBs; and a processor configured togenerate a histogram based on an output of the ToF ranging array, wherethe controller is configured to: determine an ambient count of ambientlight events generated by SPADs of a first SPAD cluster of a first SPADMB of the plurality of SPAD MBs; and gate an output of the first SPAD MBbased on the ambient count.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention, and theadvantages thereof, reference is now made to the following descriptionstaken in conjunction with the accompanying drawings, in which:

FIG. 1 shows an exemplary ToF imaging system;

FIG. 2 shows a diagram illustrating an exemplary process of histogramcreation based on ToF measurements of the ToF imaging system of FIG. 1 ;

FIG. 3 shows an exemplary implementation of an OR tree in the ToFimaging system of FIG. 1 ;

FIG. 4 shows a SPAD array that includes 16 SPAD clusters arranged in 4rows and 4 columns, where each SPAD cluster includes 16 SPADS arrangedin 4 rows and 4 columns;

FIG. 5 shows the SPAD array of FIG. 4 having only a single SPAD on ineach of the 16 SPAD clusters to avoid saturation due to the presence ofan intense light source;

FIGS. 6A-6C show a candle, corresponding SPAD map, and correspondingSPAD array response, respectively;

FIGS. 7A and 7B show the SPAD array of FIG. 4 having only a single SPADon in each of the 16 SPAD clusters and in the presence of an intense andlocalized light source, and corresponding histogram, respectively;

FIGS. 8A and 8B show the SPAD array of FIG. 4 in the presence of anintense and localized light source, and corresponding histogram,respectively, according to an embodiment of the present invention;

FIG. 9 shows a schematic diagram of a ranging circuit, according to anembodiment of the present invention;

FIG. 10 shows a schematic diagram of a ranging circuit showing apossible implementation of the controller of FIG. 9 , according to anembodiment of the present invention;

FIG. 11 shows a schematic diagram of a ranging circuit showing apossible implementation of the controllers of FIG. 10 , according to anembodiment of the present invention;

FIGS. 12-14 show flow charts of embodiment methods of determiningwhether to block an output of a SPAD macro-block (MB), according to anembodiments of the present invention;

FIGS. 15-18 show SPAD maps of simulation results implementing the methodof FIG. 14 in the presence of a candle, according to an embodiment ofthe present invention; and

FIG. 19 shows a camera with auto-focus, according to an embodiment ofthe present invention.

Corresponding numerals and symbols in different figures generally referto corresponding parts unless otherwise indicated. The figures are drawnto clearly illustrate the relevant aspects of the preferred embodimentsand are not necessarily drawn to scale.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The making and using of the embodiments disclosed are discussed indetail below. It should be appreciated, however, that the presentinvention provides many applicable inventive concepts that can beembodied in a wide variety of specific contexts. The specificembodiments discussed are merely illustrative of specific ways to makeand use the invention, and do not limit the scope of the invention.

The description below illustrates the various specific details toprovide an in-depth understanding of several example embodimentsaccording to the description. The embodiments may be obtained withoutone or more of the specific details, or with other methods, components,materials and the like. In other cases, known structures, materials oroperations are not shown or described in detail so as not to obscure thedifferent aspects of the embodiments. References to “an embodiment” inthis description indicate that a particular configuration, structure orfeature described in relation to the embodiment is included in at leastone embodiment. Consequently, phrases such as “in one embodiment” thatmay appear at different points of the present description do notnecessarily refer exactly to the same embodiment. Furthermore, specificformations, structures or features may be combined in any appropriatemanner in one or more embodiments.

Embodiments of the present invention will be described in a specificcontext, a ranging device using a ToF ranging array that includes SPADsand uses ToF techniques to determine the range to one or more objects inthe FoV of the ranging device. Embodiments of the present invention maybe used in applications such as auto-focus (AF), LiDAR, and proximitysensors, for example.

In an embodiment of the present invention, portions of the FoV of aranging device are excluded from the FoV of the ranging device (e.g.,prevented from contributing to the generation of a histogram), e.g., inorder to optimize the ranging performed of the ranging device. In someembodiments, SPAD clusters of a programmable ToF ranging array beingexcited by intense and localized light are prevented from contributingto the histogram used for performing ranging computations. In someembodiments, preventing SPAD clusters from contributing to the histogramgeneration advantageously prevents saturation of the histogram, therebyadvantageously allowing for the enablement of additional SPADs in theother SPAD clusters in the FoV of the ToF ranging array to, e.g.,maximize the dynamic range and increase the signal to ambient lightratio. In some embodiments, the excluded SPAD clusters continue to bemonitored and may be dynamically re-included in the FoV of the rangingdevice, e.g., if the intense and localize light moves and/or reduces itsintensity.

Optical ranging devices using ToF techniques rely on detecting returnedsignal from objects (targets) in their field-of-view (FoV) in order todetermine the range of these objects from the ranging device. Forexample, FIG. 1 shows exemplary ToF imaging system 100. ToF imagingsystem 100 includes illumination source 106, SPAD array 104 (alsoreferred to as a ToF ranging array), time-to-digital converter (TDC)102, and digital signal processor (DSP) 110.

During normal operation, illumination source 106 emits radiation pulse112 (e.g., a light signal) towards object 116. Reflected radiation pulse114 is sensed by SPAD array 104. TDC 102 generates a digitalrepresentation of the time between the emission of radiation pulse 112and reception of reflected radiation pulse 114. DSP 110 then processesthe information data received from TDC 102 to determine the distance toobject 116.

Illumination source 106 may be implemented in any way known in the art.For example, illumination source 106 may be implemented as avertical-cavity surface-emitting laser (VCSEL). Other implementationsare also possible.

TDC 102 may be implemented in any way known in the art. For example, TDC102 may be implemented, e.g., as described in U.S. patent applicationSer. No. 15/877,551, filed on Jan. 23, 2018, and entitled “SingleReference Clock Time to Digital Converter,” which application isincorporated herein by reference. Other implementations are alsopossible.

DSP 110 may be implemented in any way known in the art. For example, DSP110 may be a general purpose DSP, processor or controller that includes,for example, combinatorial circuits coupled to a memory. DSP 110 mayalso be implemented as a custom application-specific integrated circuit(ASIC). Other implementations are also possible.

To increase accuracy in the ToF measurements, illumination source 106may emit multiple radiation pulses 112 (e.g., arranged in frames). Forexample, illumination source 106 may, e.g., emit multiple radiationpulses during a first portion of a frame, and stop emitting radiationpulses during a second portion of the frame. SPAD array 104 may thenreceive multiple reflected radiation pulses 114. TDC 102 generatesdigital representation of the times between emission of radiation pulses112 and reception of radiation pulses 114. DSP 110 then may create ahistogram of multiple ToF measurements and determine the distance toobject 116 based on the histogram rather than based on a single ToFmeasurement.

FIG. 2 shows a diagram illustrating an exemplary process of histogramcreation based on ToF measurements of ToF imaging system 100. Duringnormal operation, illumination source 106 emits multiple radiationpulses 112 and SPAD array 104 receives multiple reflected radiationpulses 114. For each emitted radiation pulse 112, TDC 102 measures thetime Δt between emitted radiation pulse 112 and received reflected pulse114 and sends a digital code 128 based on the time Δt to DSP 110. DSP110 receives digital code 128 and updates histogram 118 by usingaccumulator 120 and incrementing (e.g., by +1) the bin in the histogramassociated with code 128.

Some imaging systems may be implemented with one TDC per SPAD in theSPAD array 104. In other words, an imaging system having a SPAD array104 of 16 SPADs may be implemented with 16 TDCs, where the DSP generatesa histogram per TDC and/or a single histogram for all the TDCs. However,some systems may reduce the number of TDCs by using an OR tree. FIG. 3shows an exemplary implementation of OR tree 132 in ToF imaging system100. As shown in FIG. 3 , SPAD cluster 130 includes 8 SPADs, where eachof the 8 SPADs is connected to OR tree 132. Although SPAD cluster 130 isshown to have 8 SPADs, SPAD cluster 130 may have a different number ofSPADs such as 4 or 16, for example.

During normal operation, reflected radiation pulse 114 stimulates one ormore of the SPADs of SPAD cluster 130. Each time one or more SPADs ofSPAD cluster 130 is stimulated, the output of OR tree 132 is asserted.TDC 102 interprets each time radiation pulse 112 is emitted as a startevent and each time the output of OR tree 132 is asserted as a stopevent, where the time Δt is the time between the start event and thestop event.

A SPAD array may include a plurality of SPAD clusters. For example, FIG.4 shows SPAD array 400 including 16 SPAD clusters 430 arranged in 4 rowsand 4 columns, where each SPAD cluster 430 includes 16 SPADS arranged in4 rows and 4 columns (some of SPAD clusters 430 have not been labeled inFIG. 4 for clarity purposes). Each of the 16 SPAD clusters 430 covers aportion of the FoV of SPAD array 400. In some embodiments, SPAD array400 may be a portion of a larger SPAD array. SPAD array 400 operates ina similar manner as SPAD array 104.

The ranging performance, of an optical ranging device, in terms oftarget detection and corresponding range uncertainty, may be degraded byambient light. For example, ambient light may stimulate one or moreSPADs in SPAD cluster 130, thereby causing the output of OR tree 132 toassert even though no reflected radiation pulse 114 has been received.

In a ranging device, such as a lensed ranging device, some ambient lightsources may appear as a uniform ambient level (a substantially uniformnumber of events per bin in the histogram) across the whole FoV of thedevice (ambient light causes each SPAD cluster 130 to output asubstantially similar number of events). If the ambient light source istoo intense, it may cause each OR tree 132 to become saturated and missevents.

To avoid saturation of the OR tree, one or more SPADs of each SPADcluster 130 may be (dynamically) turned off (e.g., each frame), therebyreducing the number of assertions of the output of OR tree 132. DynamicSPAD selection (DSS) may be performed, e.g., as described in U.S. patentapplication Ser. No. 15/886,353, filed on Feb. 1, 2018, and entitled“Method and Apparatus for Processing a Histogram Output from a DetectorSensor,” which application is incorporated herein by reference. Forexample, FIG. 5 shows SPAD array 400 having only a single SPAD on ineach of the 16 SPAD clusters 430 to avoid saturation due to the presenceof an intense light source (not shown) in its FoV.

Some ambient light sources may appear as a structured or localizedambient level occupying only part of the FoV of the SPAD array. Forexample, FIGS. 6A-6C show candle 602, corresponding SPAD map 604, andcorresponding SPAD array response 606, respectively, where the SPADarray is implemented in a ranging device with 60 degrees of FoV.

As shown in FIGS. 6B and 6C, the SPAD response to the presence of anintense and localized light source, such as candle 602, is alsolocalized. As shown in FIG. 6C, although the number of events generatedby ambient light is generally low, the peak number of events generatedby candle 602 is substantially higher, which may cause the overallnumber of events of the entire FoV of the SPAD array to saturate thecorresponding histogram.

FIG. 7A shows SPAD array 400 having only a single SPAD on in each of the16 SPAD clusters 430 and in the presence of intense and localized lightsource 704 in its FoV. Intense and localized light source 704 may be,e.g., a candle, the sun, a light bulb, etc.

Intense and localized light source 704 may cause the total number ofevents generated by the output of OR tree 132 of each cluster tosaturate the corresponding histogram. As a result, in the example ofFIG. 7A, a single SPAD per cluster 430 is turned on (e.g., by performingDSS) to avoid or reduce the risk of saturation of the histogram.

FIG. 7B shows histogram 710 corresponding to SPAD array 400 in thepresence of intense and localized light source 704 (as shown in FIG.7A). Histogram 710 includes peak 712, corresponding to target 702, andambient light level 714. In the example of FIG. 7B, saturation isreached at about 25 million cycles per second (MCPS).

As shown in FIG. 7B, peak 712 of histogram 710 corresponds to eventsassociated with reflected radiation pulses 114 from target 702. Theevents corresponding to peak 712 are dominated mostly by 6 SPADs (SPADSin columns 2 and 3, rows 1-3, as shown in FIG. 7A). The events ofambient light level 714 are dominated by 2 SPADs (the SPADS in row 4,columns 2 and 3, as shown in FIG. 7A).

As shown in FIG. 7B, histogram 710 exhibits poor signal to ambient ratio(ratio between peak 712 and average ambient light value 714). If theambient light from intense and localized sources is included into arange determination for a given target, it may severely degrade theranging device's ability to detect targets and measure range reliably.

In an embodiment of the present invention, SPAD clusters thatdisproportionately contribute to the increase of the ambient light leveland/or reduce the signal to ambient light ratio are excluded from theFoV of the SPAD array, e.g., to minimize the degradation caused byintense and localized ambient light sources.

FIGS. 8A and 8B show SPAD array 400 having SPAD clusters exposed tointense and localized light source 704 excluded from the FoV of SPADarray 400, and corresponding histogram 810, respectively, according toan embodiment of the present invention.

As shown in FIG. 8A, intense and localized light source 704 is localizedmostly in SPAD clusters 802 and 804, corresponding to row 4, columns 2and 3. Blocking (preventing) clusters 802 and 804 from contributingevents to the generation of the histogram 810 causes the ambient lightlevel to reduce. As a result, more SPADs can be turned on (e.g., byperforming DSS) without saturating the OR tree 132. In the example ofFIG. 8A, 4 SPADs per SPAD cluster 430 may be enabled using DSS withoutsaturating the OR tree 132 (as reflected in FIG. 8B).

As shown in FIG. 8B, histogram 810 includes peak 812, corresponding totarget 702, and ambient light level 814. As shown in FIG. 8B, byexcluding clusters 802 and 804 from the generation of events ofhistogram 810, ambient light level 814 is about 4 times smaller thanambient light level 714, even though 4 SPADs per cluster 430 are used tocapture light and generate corresponding events (instead of 1 SPAD percluster, as shown in FIG. 7A).

In the embodiment of FIG. 8B, saturation is reached at about 25 MCPS. Inother embodiments, OR tree saturation may be reached at a number higherthan 25 MCPS, such as 30 MCPS, 50 MCPS or higher, or at a number lowerthan 25 MCPS, such as 20 MCPS, 10 MCPS, or lower.

Similar to FIG. 7B, peak 812 of histogram 810 corresponds to eventsassociated with reflected radiation pulses 114 from target 702. However,since 4 SPADs per cluster are active in the embodiment of FIGS. 8A and8B, the events corresponding to peak 812 are dominated mostly by 17SPADs (SPADS in columns 2 and 3, rows 1-3, and column 4, row 4, as shownin FIG. 8A) instead of 6 SPADs (as shown in FIG. 7A). The events ofambient light level 814 are substantially uniformly generated by the 56SPADs in the unblocked SPAD clusters 430 (all of the SPADs thatcontribute to the generation of histogram 810).

As shown in FIGS. 7B and 8B, histogram 810 exhibits a signal to ambientlight ratio that is about 16 times higher than the signal to ambientlight ratio of histogram 710. In some embodiments, the improved signalto ambient light ratio may cause better ranging performance, such as ahigher maximum distance that can be measured and better repeatability.

It is understood that, although SPAD array 400 is shown in the Figuresas including 256 SPADs in 16 SPAD clusters 430, a different number ofSPADs per cluster 430 and a different number of SPAD clusters 430 in theSPAD array 400 may also be used. It is also understood that SPAD array400 may be a portion of a larger SPAD array. For example, in someembodiments, SPAD array 400 may represent the region of interest (ROI)of a larger SPAD array.

In some embodiments, SPAD clusters 430 may be implemented inside SPADmacro-blocks (MBs), where each SPAD MB, in addition to having a SPADcluster 430, includes other circuits, such as an OR tree, for example.

In an embodiment of the present invention, a central controllerdetermines, based on the number of events generated by a SPAD MB,whether such SPAD MB should contribute to the generation of a histogram.If the central controller determines that the SPAD MB should notcontribute to the generation of the histogram, the output of such SPADMB is gated. In some embodiments, a monitor circuit that monitors thenumber of events generated by a SPAD cluster of the blocked SPAD MBcontinues to report the number of events to the central controller eventhough the output of the blocked SPAD MB is gated. In some embodiments,continuing to monitor the number of events generated by a blocked SPADcluster advantageously allows the central controller to unblock (removethe gating) the output of the SPAD MB, e.g., based on the number ofevents generated by the blocked SPAD cluster.

FIG. 9 shows a schematic diagram of ranging circuit 900, according to anembodiment of the present invention. Ranging circuit 900 may be part ofa ToF imaging system, such as ToF imaging system 100. Ranging circuit900 includes M SPAD MBs 940, controller 902, and DSP 110, where M is aninteger number greater than 1, such as 8, 12, 16, 20, 32, or othernumber. Each of the M SPAD MBs include a SPAD cluster 930 and an OR tree932. Each SPAD cluster 930 includes N SPADs, e.g., arranged in rows andcolumns, where N is an integer number greater than 1, such as 8, 16, 20,or other number.

During normal operation, SPAD clusters 930 inside each of the SPAD MBs940 are stimulated by reflected radiation pulses 114 and by ambientlight. The outputs of OR trees 932 are asserted each time theircorresponding SPAD cluster 930 is stimulated. Controller 902 receivesinformation from the outputs of OR trees 932 (e.g., directly, or via aTDC—not shown) and forwards (e.g., some) information to DSP 110, whichgenerates histogram 910.

Controller 902 receives information from histogram 910 and turns on andoff the number of SPADs of SPAD clusters 930, e.g., to avoid saturatingOR tree 932 (e.g., by performing DSS). For example, if the currentnumber of SPADs per SPAD cluster is 4, and histogram 910 is saturated,controller 902 then may reduce the number of active SPADs per SPADcluster 930 to 3 (e.g., for the next frame).

Controller 902 also monitors the number of events generated per SPADcluster 930. If controller 902 determines that a SPAD cluster 930 isproducing a disproportionate number of events compared to the other SPADclusters 930, the controller 902 may prevent such SPAD cluster 930 fromcontributing to the generation of histogram 910. For example, in theembodiments of FIGS. 8A and 8B, controller 902 prevents SPAD clusters802 and 804 from contributing to the generation of histogram 910.

In some embodiments, controller 902 prevents a SPAD cluster 930 fromcontributing to the generation of histogram 910 by disabling the SPADcluster 930 (e.g., turning off the SPAD cluster 930 by removing biasing)and/or disabling the SPAD MB 940 (e.g., by removing power from SPAD MB940), e.g., using signal S_(block). In other embodiments, controller 902prevents a SPAD cluster 930 from contributing to the generation ofhistogram 910 by gating the output of OR tree 932 (e.g., by using ahardware circuit), e.g., without turning off the corresponding SPADcluster 930 and SPAD MB 940. In some embodiments, by keeping the blockedSPAD MB 940 active, controller 902 may continue to monitor the output ofsuch blocked SPAD MB 940 and (dynamically) re-enable such blocked SPADMB 940 (e.g., during the next frame) if it becomes advantageous to do so(e.g., if the blocked SPAD MB 940 is no longer exposed to an intense andlocalized light source).

In some embodiments, a portion or all of controller 902 may beimplemented as part of DSP 110. For example, if controller 902 isimplemented as part of DSP 110, the gating of the output of OR tree 932may be performed digitally (e.g., by not adding events from such SPADcluster 930 into histogram 910).

In other embodiments, controller 902 may be implemented in hardware(e.g., by using custom logic). In yet other embodiments, a portion ofcontroller 902 may be implemented in hardware and another portion ofcontroller 902 may be implemented in DSP 110.

FIG. 10 shows a schematic diagram of ranging circuit 1000 showing apossible implementation of controller 902, according to an embodiment ofthe present invention. Controller 902 includes central controller 1010,and M local controllers 1012. Each local controller 1012 includesmonitor circuit 1013 and gating circuit 1016. In some embodiments,controller 902 also performs the operations associated with elements1002, 1004, 1006, and 1008.

During startup of ranging circuit 1000, dark counter read (DCR) defectmap generator 1002 generates a DCR map to identify malfunctioning SPADsin the SPAD array (where the SPAD array includes M SPAD clusters 930).MB DSS pattern generator 1004 generates (e.g., N) patterns to be usedwhen a particular number of SPADs are to be enabled per SPAD cluster 930(e.g., where N is the number of SPADs in each SPAD cluster 930). Forexample, if 4 SPADs are to be enabled per cluster 930, MB DSS patterngenerator 1004 generates a pattern that enables 4 SPADs, e.g., that aredistributed in the SPAD cluster 930.

DSS look-up table (LUT) generator 1006 generates a LUT per SPAD MBindicating the SPAD pattern (which SPADs are to be turned on) based onthe number of SPADs desired to be turned on. For example, with respectto SPAD array 400, the DSS LUT for a SPAD pattern of 1 (1 SPAD enabled)may look, e.g., as shown in FIG. 7A. As another example, with respect toSPAD array 400, the DSS LUT for a SPAD pattern of 4 (4 SPADs enabled)may look, e.g., as shown in FIG. 8A.

The DSS LUTs generated by DSS LUT generator 1006 may take intoconsideration defective SPADs. For example, a SPAD pattern of 4 may lookdifferent in a SPAD cluster 930 having a defective SPAD since such SPADcluster 930 would turn on a different SPAD so that it has 4 SPADs on.

The DSS LUTs are stored in DSS LUT circuit 1008 (which may be, e.g., avolatile or non-volatile memory).

After startup, ranging device 1000 generates timing measurements,arranged in frames, based on the output of the OR trees 932. During eachframe, central controller 1010 may determine the number of SPADs to beenabled for each SPAD cluster 930 to avoid saturation of OR tree 932while maximizing the number of active SPADs per SPAD cluster 930 (e.g.,by performing DSS). Which SPADs are enabled in each SPAD cluster 930 isbased on the DSS patterns stored in DSS LUT circuit 1008.

Local controller 1012 monitors the number of events generated by therespective OR tree 932 using monitor circuit 1014. Local controller 1012reports the number of events to central controller 1010.

Central controller 1010 receives information from monitor circuit 1014of each SPAD MB 1040 and determines whether one or more SPAD MBs 1040are generating events that, e.g., are detrimental to the performance ofranging device 1000. For example, central controller 1010 may determinethat a particular SPAD MB 1040 is generating a disproportionate numberof ambient events (e.g., because it is exposed to an intense andlocalized light source) based on the outputs of one or more monitorcircuits 1014. Central controller 1010 then may gate (block) the outputof one or more SPAD MBs 1040 that central controller 1010 determinedwere detrimental to the performance of ranging device 1000 (such as SPADclusters 802 and 804 in the embodiment of FIGS. 8A and 8B).

Once central controller 1010 determines which SPAD MB 1040 to block,central controller 1010 gates the output of the OR tree 932 of theblocked SPAD MB 1040 using the corresponding gating circuit 1016.

In some embodiments, monitor circuit 1014 continues to monitor theoutput of OR tree 932 even though gating circuit 1016 may be preventingsuch output from contributing to the generation of histogram 910. Insome embodiments, central controller 1010 may unblock a blocked SPAD MB1014 based on the output of the corresponding monitor circuit 1014(e.g., when the intense and localize light source is removed).

FIG. 11 shows a schematic diagram of ranging circuit 1100 showing apossible implementation of controllers 1010 and 1012, according to anembodiment of the present invention. Central controller 1010 includesSPAD MB selector 1102, DSS ROI allocator 1104, and DSS number of SPADsgenerator 1106. Local controller 1012 includes monitor circuit 1014 andgating circuit 1016. Monitor circuit 1014 includes signal counter 1116and ambient counter 1118. Gating circuit 1016 includes D-flip-flop 1108and AND gate 1110.

During normal operation, signal counter 1116 counts the number of eventsgenerated by OR tree 932 that are associated to a signal (e.g., from atarget in the FoV of ranging circuit 1100) and ambient counter 1118counts the number of events generated by OR tree 932 that are associatedto ambient light (e.g., when illuminator 106 is not illuminating the FoVof ranging circuit 1100). The count signal generated by signal countermay also include events generated by ambient light).

SPAD MB selector 1102 receives the number of events from counters 1116and 1118 of each SPAD MB 1040 and determines whether to gate the outputof one or more SPAD MBs 1040. When SPAD MB selector 1102 determines thatthe output of a particular SPAD MB 1040 should be blocked (gated), SPADMB selector 1102 causes the D-flip-flop 1108 of such SPAD MB 1040 toclock in a “o” so that the corresponding Q output is “0,” therebycausing the output of AND gate 1110 to be “o” (regardless of the stateof the output of OR tree 932).

DSS number of SPADs generator determines, e.g., based on histogram 910,the total number of SPADs (e.g., from the SPADs in the ROI) that shouldcontributes to the generation of histogram 910 to maximize the dynamicrange of histogram 910 without saturating OR tree 932.

DSS ROI allocator 1104 determines which SPADs to turn on in each SPAD MB1040 based on the total number of SPADs that should contribute to thegeneration of histogram 910 (from DSS number of SPAD generator 1106), onwhether one or more SPAD MBs 1040 are prevented from contributing to thegeneration of histogram 910 (from SPAD MB selector 1102) and on the LUTs(from DSS LUT circuit 1008). For example, if DSS number of SPADgenerator 1106 determines that 56 SPADs should contribute to thegeneration of histogram 910, and DSS ROI allocator receives informationfrom SPAD MB selector 1102 that two SPAD MBs 1040 are disabled, then DSSROI allocator enables 4 SPADs per SPAD MB 1040 (e.g., as shown in FIG.8A, for example).

In some embodiments, although the output of a particular SPAD MB 1040may be gated by gating circuit 1016, counters 1116 and 1118 may continueto report the number of events generated by the corresponding SPADcluster 930 to SPAD MB selector 1102, e.g., so that SPAD MB selector1102 may re-enable the blocked SPAD MB 1040, e.g., if it becomesdesirable to do so (e.g., in the next frame).

In some embodiments, SPAD MB selector 1102 performs DSS for gated SPADMBs 1040 (via DSS ROI allocator 1104) to prevent saturation of theirrespective OR trees 932.

Counter 1116 and 1118 may be implemented in any way known in the art.For example, in some embodiments, counter 1116 and 1118 is implementedas a digital counter.

In some embodiments, counters 1116 and 1118 may be implemented by asingle digital counter. For example, in some embodiments, the singledigital counter may produce a signal count, associated with reflectedradiation pulses, during 8/9^(th) of a frame (e.g., when illuminationsource 106 is pulsing). Such signal count may be stored or transmittedto SPAD MB 1102. The single digital counter may then be reset, and thesingle digital counter may count for the remaining 1/9^(th) of the framean ambient count (e.g., when illumination source 106 is not pulsing).Such ambient count may be stored or transmitted to SPAD MB 1102. Thesingle digital counter may then be reset to count the signal countduring the next frame.

In some embodiments, signal counter 1116 counts events during a firstportion of time of a frame, such as 8/9^(th) of a frame, where theilluminator 106 is illuminating the FoV of ranging circuit 1100. In someembodiments, ambient counter 1118 counts events during a second portionof time of a frame, such as 1/9^(th) of a frame, where the illuminator106 is not illuminating the FoV of ranging circuit 1100 (e.g., whenilluminator 106 is off). Other durations of the first and second timeportions may be used. The first time portion may occur at the beginningof the frame, or at a different time (e.g., at the end of the frame).The second time portion may occur at the end of the frame, or at adifferent time (e.g., at the beginning of the frame).

In some embodiments, the total number of events received during theframe (signal events+ambient events) may be approximated by multiplyingthe signal count (the count of counter 1116) times the inverse of thefractional duration of the first time portion (e.g., 9/8^(th)). In otherembodiments, the total number of events received during the frame may besimply approximated as the signal count (the count of counter 1116).

In some embodiments, the total number of events associated to theambient level received during the frame may be approximated bymultiplying the ambient count (the count of counter 1118) times theinverse of the fractional duration of the second time portion (e.g., 9).

As mentioned before, in some embodiments, the number of eventsassociated with the signal counter includes contributions from ambientlight. Therefore, the actual number of events associated to the signal(e.g., from a target and without ambient light contributions) may beapproximated as the total number of events (e.g., based on counter 1116)minus the ambient number of events (based on counter 1118).

Although FIG. 11 shows gating circuit 1016 implemented with aD-flip-flop 1108 and an AND gate 1110, it is understood that gatingcircuit 1016 may be implemented with alternative logic circuits, such asother types of logic gates and/or other types of flip-flops, forexample.

FIG. 12 shows a flow chart of embodiment method 1200 of determiningwhether to block an output of a SPAD MB 1040, according to an embodimentof the present invention. Method 1200 may be implemented by, e.g.,ranging circuits 900, 1000, and 1100.

During step 1202, an ambient count of an ambient counter (e.g., counter1118) configured to count the number of events associated with ambientlight is received. The ambient counter may be configured to count thenumber of events from a SPAD cluster (e.g., 930) when, e.g., the VCSEL(e.g., 106) is off.

In some embodiments, the ambient count may be determined each frame.Since the illuminator 106 may be pulsing (on) at least during a portionof the frame, there may be a limited time to determine the ambient count(when the illuminator 106 is off). In some embodiments, the ambientcounter may only count the number of events during a small fraction ofthe duration of the frame, such as 15% of the duration of the frame, orless, such as 1/9^(th) of the duration of the frame.

During step 1204, the total number of ambient light events generatedduring the frame is determined/estimated. For example, if ambientcounter counts events during 1/9^(th) the time of the frame, the ambientcount may be multiplied times 9, and the result may be used as theapproximate number of ambient light events generated during the frame.

During step 1206, if it is determined that the number of ambient lightevents during the frame is higher than an ambient light threshold, theSPAD MB is prevented (blocked) from contributing to the generation ofthe histogram (e.g., 910) during step 1208 (e.g., by using gatingcircuit 1016). If the number of ambient light events during the frame islower than the ambient light threshold, the SPAD MB is allowed tocontribute to the generation of the histogram during step 1210 (e.g., bykeeping the SPAD MB enabled or re-enabling the SPAD MB).

In some embodiments, since reaching a determination during step 1206 mayoccur at or near the end of a frame, the action taken (e.g., either toblock or not to block a SPAD MB) may take effect during the next frame).In some embodiments, events from several frames are accumulated duringan integration time (e.g., 15 ms), and the desired blocking is/arecalculated based on such accumulated events.

In some embodiments, method 1200 is performed for each SPAD MB 1040during each frame (e.g., regardless of whether the output of theparticular SPAD MB 1040 is blocked). If, during step 1206, it isdetermined that a blocked SPAD MB has a number of ambient light eventslower than the ambient light threshold, such blocked SPAD MB may beunblocked during step 1210, and be allowed to contribute to thegeneration of the histogram.

In some embodiments, step 1204 may be omitted and step 1206 may performthe comparison directly using the ambient count from the ambient counter(e.g., where the ambient threshold used is a scaled version of theambient threshold used if step 1204 is performed).

Some embodiments implementing method 1200 may avoid implementing signalcounter 1116.

FIG. 13 shows a flow chart of embodiment method 1300 of determiningwhether to block an output of a SPAD MB 1040, according to an embodimentof the present invention. Method 1300 may be implemented by, e.g.,ranging circuits 900, 1000, and 1100.

Steps 1202, 1204, 1208 and 1210 may be performed, e.g., as describedwith respect to FIG. 12 .

During step 1302, a signal count of a signal counter (e.g., counter1116) configured to count the number of events associated with a signalreflected from a target in the FoV of the ranging circuit (e.g., 1100)is received. The signal counter may be configured to count the number ofevents from a SPAD cluster (e.g., 930) when, e.g., the VCSEL (e.g., 106)is pulsing (on).

In some embodiments, the signal count may be determined each frame.Since the illuminator 106 may stop pulsing for at least during a portionof the frame (e.g., to allow for step 1202 to be performed), the signalcounter only counts the number of events during a fraction of theduration of the frame, such as 85% of the duration of the frame, orhigher, such as 8/9^(th) of the duration of the frame. Other durationsare also possible.

As mentioned before, the signal count may include events associated withambient light. During step 1304, the total number of events(signal+ambient) received during the frame may be determined based onthe signal count. For example, in some embodiments, the total number ofevents may be determined by multiplying the signal count times theinverse of the fractional duration of the time portion in which theevents where captured (e.g., 9/8^(th)). In other embodiments, the totalnumber of events associated to the signal may be simply approximated asthe signal count.

During step 1306, the total number of signal events is determined, e.g.,by subtracting the total number of events (e.g., from step 1304) minusthe total number of ambient events (e.g., from step 1204). In someembodiments, steps 1204 and 1304 may be omitted and the total number ofsignal events may be determined, e.g., based directly from the ambientcount (e.g., from step 1202) and the signal count (e.g., from step1302).

During step 1308, the signal to ambient ratio is determined, e.g., bydiving the total number of signal events (e.g., from step 1306) over thetotal number of ambient events (e.g., from step 1204). In someembodiments, steps 1204, 1304 and 1306 may be omitted and the signal toambient ratio may be determined directed from the ambient count (e.g.,from step 1202) and the signal count (e.g., from step 1302).

During step 1310, if it is determined that the signal to ambient ratiois lower than a ratio threshold, the SPAD MB is prevented (blocked) fromcontributing to the generation of the histogram (e.g., 910) during step1208 (e.g., by using gating circuit 1016). If it is determined that thesignal to ambient ratio is higher than the ratio threshold, the SPAD MBis allowed to contribute to the generation of the histogram during step1210.

FIG. 14 shows a flow chart of embodiment method 1400 of determiningwhether to block an output of a SPAD MB 1040, according to an embodimentof the present invention. Method 1400 may be implemented by, e.g.,ranging circuits 900, 1000, and 1100.

Steps 1202, 1204, 1302, 1304, and 1306 may be performed, e.g., asdescribed with respect to FIGS. 12 and 13 .

During step 1402, a confidence value C of the SPAD MB is determined,e.g., by

$\begin{matrix}{C = \frac{S - {W \cdot \sqrt{S}}}{A}} & (1)\end{matrix}$where S is the total number of signal events (e.g., from step 1306), Ais the total number of ambient events (e.g., from step 1204), and W is afactor that may be, e.g., from 1 (or lower) to 6 (or higher). In someembodiments, the higher the factor W, the higher the signal to ambientratio associated with the contributions of such SPAD MB to the histogram(e.g., 910).

Once step 1402 is performed for all M SPAD MBs, the SPAD MBs are sorted,during step 1404, based on their respective confidence value C[i], whereC[0] corresponds to the SPAD MB with the highest confidence value, andC[M−1] corresponds to the SPAD MB with the lowest confidence value.

During step 1406, the variables i, aggregate signal, and aggregateambient are initialized to correspond to the SPAD MB[0], which has thehighest confidence value C[0].

During step 1408, a variable C_(agg), representing the confidence valueof the aggregate of all SPAD MBs (only including SPAD MB[0] at thispoint) is initialized as equal to confidence value C[0].

During step 1410, a new set of SPAD MBs that include SPAD MBs 0 to i, isgenerated and the total number of signal events of all SPAD MBs 0 to iare aggregated into the variable aggregate_signal, and the total numberof ambient events of all SPAD MBs 0 to i are aggregated into thevariable aggregate_ambient.

During step 1412, a new confidence value C_(new_agg) of the new set ofSPAD MBs (from 0 to i) is generated, e.g., using Equation 1.

During step 1414, a determination is made as to whether the newconfidence value C_(new_agg) (associated to SPAD MBs 0 to i) is higherthan or equal to the confidence value C_(new) (associated to SPAD MBs 0to i−1) times a strength variable, where the strength variable is avalue from 0 to 1, inclusive. If step 1414 returns no, then adding theadditional SPAD MB i, and any additional SPAD MBs i+1 to M−1 (since theSPAD MBs are sorted) would cause the confidence value to degrade andtherefore, SPAD MBs i−1 to M−1 are blocked (e.g., using gating circuit1016).

If step 1416 returns yes, then the SPAD MB is included in the set ofaggregate SPAD MBs, the index i is incremented, and confidence valueC_(agg) is updated with the confidence value C_(new_agg) of the new setof aggregate SPAD MBs during step 1418.

During step 1420, if index i is not lower than M, then all of the SPADMBs have been considered, and no SPAD MB is blocked during step 1422. Ifindex i is lower than M, step 1410 is repeated with the updated index i.

FIG. 15-18 show SPAD maps of simulation results implementing method 1400in the presence of candle 704, according to an embodiment of the presentinvention. Legend 1510 applies to SPAD maps 1502, 1504, 1506, 1508,1602, 1604, 1606, 1608, 1702, 1704, 1706, 1708, 1802, 1804, 1806, and1808. Legend 1512 applies to SPAD maps 1504, 1508, 1604, 1608, 1704,1708, 1804, and 1808. Legend 1514 applies to SPAD maps 1506, 1606, 1706,and 1806. As shown in FIGS. 15-18 , the SPAD array 1520 has 23 rows and39 columns of SPADs for a total of 897 SPADs. The ROI is divided into 4SPAD MBs, as shown in SPAD map 1502.

As shown in SPAD map 1502, candle 702 excites SPADs in the lower leftquadrant of the ROI of SPAD array 1520. SPAD map 1504 shows all SPAD MBsin the ROI enabled (before method 1400 is performed). SPAD map 1506shows that, after performing method 1400, the SPAD MB at the lower leftquadrant is blocked. SPAD map 1508 shows that the SPADs at the top twoquadrants and at the bottom right quadrant are enabled and contributingto the generation of histogram 910 after method 1400 is performed.

As shown in SPAD map 1602, candle 702 excites SPADs in the lower twoquadrant of the ROI of SPAD array 1520. SPAD map 1604 shows all SPAD MBsin the ROI enabled (before method 1400 is performed). SPAD map 1606shows that, after performing method 1400, the SPAD MB at the lower twoquadrants are blocked. SPAD map 1608 shows that the SPADs at the top twoquadrants are enabled and contributing to the generation of histogram910 after method 1400 is performed.

As shown in SPAD map 1702, candle 702 excites SPADs in the lower rightquadrant of the ROI of SPAD array 1520. SPAD map 1704 shows all SPAD MBsin the ROI enabled (before method 1400 is performed). SPAD map 1706shows that, after performing method 1400, the SPAD MB at the lower rightquadrant is blocked. SPAD map 1708 shows that the SPADs at the top twoquadrants and at the lower left quadrant are enabled and contributing tothe generation of histogram 910 after method 1400 is performed.

As shown in SPAD map 1802, candle 702 does not excite any SPADs in theROI of SPAD array 1520. SPAD map 1804 shows all SPAD MBs in the ROIenabled (before method 1400 is performed). SPAD map 1806 shows that,after performing method 1400, none of the SPAD MBs are blocked. SPAD map1808 shows that the SPADs in all quadrants are enabled and contributingto the generation of histogram 910 after method 1400 is performed.

FIG. 19 shows camera 1900 with auto-focus, according to an embodiment ofthe present invention. Camera 1900 includes lens 1908, auto-focus engine1904, and ToF ranging system 1902. ToF ranging system 1902 may beimplemented, e.g., as shown and described with respect to FIG. 1 ,includes a ranging circuit according to embodiments of the presentinvention, such as ranging circuits 900, 1000, and 1100, and implementsmethods of determining whether to block an output of a SPAD MB accordingto embodiments of the present invention, such as methods 1200, 1300, and1400.

During normal operations, ToF ranging system determines the distance totarget 1910 using, for example, one of methods 1200, 1300, or 1400. ToFranging system 1902 transmits distance information based on thegenerated histogram (e.g., 930) to auto-focus engine 1904, which adjustslens 1908 to have a focal point based on the information received fromToF ranging system 1902.

Target 1910 may be a target with an intense and localize light source,such as a candle, a light bulb, a window behind a person, etc. Target1910 may also be a target without an intense and localized light source.

Auto-focus engine 1904 and lens 1908 may be implemented in any way knownin the art.

Advantages of some embodiments include increasing the signal to ambientlight ratio and the performance of the ranging device in the presence ofan intense and localized light source. Additional advantages of someembodiments include enabling ranging to longer distances with betterrepeatability in structured high ambient light scenarios.

Example embodiments of the present invention are summarized here. Otherembodiments can also be understood from the entirety of thespecification and the claims filed herein.

Example 1. A method for operating a time-of-flight (ToF) ranging array,the method including: illuminating a field-of-view (FoV) of the ToFranging array with radiation pulses; receiving reflected radiationpulses with a plurality of single photon avalanche diodes (SPADs) in aregion of interest (ROI) of the ToF ranging array, the plurality ofSPADs arranged in a plurality of SPAD clusters; determining an ambientcount of ambient light events generated by SPADs of a first SPAD clusterof the plurality of SPAD clusters; and gating an output of the firstSPAD cluster based on the ambient count.

Example 2. The method of example 1, further including counting eventsgenerated by an OR tree coupled to the SPADs of the first SPAD clusterto determine the ambient count.

Example 3. The method of one of examples 1 or 2, further includingstopping illuminating the FoV of the ToF ranging array, wheredetermining the ambient count includes counting events generated bySPADs of the first SPAD cluster after stopping illuminating the FoV ofthe ToF ranging array.

Example 4. The method of one of examples 1 to 3, where gating the outputof the first SPAD cluster includes gating the output of the first SPADcluster when the ambient count is higher than an ambient threshold.

Example 5. The method of one of examples 1 to 4, further includingdetermining a signal count of events associated with the reflectedradiation pulses by monitoring events generated by SPADs of the firstSPAD cluster, where gating the output of the first SPAD cluster isfurther based on the signal count.

Example 6. The method of one of examples 1 to 5, further includingdetermining a signal to ambient ratio based on the signal count and theambient count, where gating the output of the first SPAD clusterincludes gating the output of the first SPAD cluster when the signal toambient ratio is lower than a ratio threshold.

Example 7. The method of one of examples 1 to 6, further includingdetermining a confidence value based on the signal count and the ambientcount by

${C = \frac{S - {W \cdot \sqrt{S}}}{A}},$where C is the confidence value, S is the signal count, A is the ambientcount, and W is a number between 0 and 1, inclusive, where gating theoutput of the first SPAD cluster includes gating the output of the firstSPAD cluster when the confidence value is lower than a confidencethreshold.

Example 8. The method of one of examples 1 to 7, where the confidencethreshold is based on a second confidence value associated with a secondSPAD cluster of the plurality of SPAD clusters.

Example 9. The method of one of examples 1 to 8, further including:determining a respective confidence value of each SPAD cluster of theplurality of SPAD clusters based on ambient and signal counts of therespective SPAD cluster, where determining the respective confidencevalue includes determining the confidence value of the first and secondSPAD clusters; sorting the plurality of SPAD clusters in a sorted orderbased on respective confidence values of each SPAD cluster of theplurality of SPAD clusters; and determining, sequentially in the sortedorder, whether to gate an output of each SPAD cluster.

Example 10. The method of one of examples 1 to 9, where the confidencethreshold is based on a second confidence value associated with aplurality of SPAD clusters of the plurality of SPAD clusters.

Example 11. The method of one of examples 1 to 10, where the confidencethreshold is equal to the second confidence value times a strengthvalue, where the strength value is a number between 0 and 1, inclusive.

Example 12. The method of one of examples 1 to 11, further includingmonitoring events generated by SPADs of the first SPAD cluster aftergating the output of the first SPAD cluster.

Example 13. The method of one of examples 1 to 12, where gating theoutput of the first SPAD cluster includes turning off the first SPADcluster.

Example 14. The method of one of examples 1 to 13, where gating theoutput of the first SPAD cluster includes changing a state of aflip-flop.

Example 15. The method of one of examples 1 to 14, where illuminatingthe FoV of the ToF ranging array includes using a vertical-cavitysurface-emitting laser (VCSEL).

Example 16. A ranging circuit including: a plurality of single photonavalanche diode (SPAD) macro-blocks (MBs), each SPAD MB including arespective SPAD cluster and a respective OR tree; a controller coupledto an output of the respective OR tree of each SPAD MB of the pluralityof SPAD MBs; and a processor configured to generate a histogram based onan output of one or more SPAD MBs of the plurality of SPAD MBs, wherethe controller is configured to: determine an ambient count of ambientlight events generated by SPADs of a first SPAD cluster of a first SPADMB of the plurality of SPAD MBs; and gate an output of the first SPAD MBbased on the ambient count.

Example 17. The ranging circuit of example 16, where the first SPAD MBincludes a local controller including: a monitor circuit coupled to theoutput of the respective OR tree and configured to monitor eventsgenerated by the first SPAD cluster; and a gate circuit coupled to theoutput of the respective OR tree and configured to, when enabled,prevent the output of the respective OR tree to propagate to the outputof the first SPAD MB, where the controller includes the localcontroller.

Example 18. The ranging circuit of one of examples 16 or 17, where themonitor circuit includes a digital counter coupled to the output of therespective OR tree, the digital counter configured to generate theambient count.

Example 19. The ranging circuit of one of examples 16 to 18, where themonitor circuit further includes a second digital counter coupled to theoutput of the respective OR tree, where the second digital counter isconfigured to generate a signal count, and where the controller isconfigured to gate the output of the first SPAD MB based on the ambientcount and on the signal count.

Example 20. The ranging circuit of one of examples 16 to 19, where thecontroller includes a plurality of local controllers, each localcontroller of the plurality of local controllers being included in acorresponding SPAD MB of the plurality of SPAD MBs, where each localcontroller includes: a respective monitor circuit coupled to the outputof the respective OR tree and configured to monitor events generated bythe respective SPAD cluster; and a respective gate circuit coupled tothe output of the respective OR tree and configured to, when enabled,prevent the output of the respective OR tree to propagate to the outputof the respective SPAD MB.

Example 21. The ranging circuit of one of examples 16 to 20, where eachgate circuit includes a respective flip-flop and a respective AND gatehaving a first input coupled to an output of the respective flip-flop,and a second input coupled to an output of the respective OR tree, wherethe respective gate circuit is selectively enabled by changing a stateof the respective flip-flop.

Example 22. The ranging circuit of one of examples 16 to 21, where theprocessor includes a portion of the controller.

Example 23. A device including: an illuminator circuit configured toilluminate a field-of-view (FoV) of the device with radiation pulses; atime-of-flight (ToF) ranging array including a plurality of singlephoton avalanche diode (SPAD) macro-blocks (MBs), each SPAD MB includinga respective SPAD cluster and a respective OR tree, the ToF rangingarray configured to receive reflected radiation pulses; a controllercoupled to an output of the respective OR tree of each SPAD MB of theplurality of SPAD MBs; and a processor configured to generate ahistogram based on an output of the ToF ranging array, where thecontroller is configured to: determine an ambient count of ambient lightevents generated by SPADs of a first SPAD cluster of a first SPAD MB ofthe plurality of SPAD MBs; and gate an output of the first SPAD MB basedon the ambient count.

Example 24. The device of example 23, further including: a lens; and anauto-focus engine, where the auto-focus engine is configured to adjustthe lens based on histogram.

While this invention has been described with reference to illustrativeembodiments, this description is not intended to be construed in alimiting sense. Various modifications and combinations of theillustrative embodiments, as well as other embodiments of the invention,will be apparent to persons skilled in the art upon reference to thedescription. It is therefore intended that the appended claims encompassany such modifications or embodiments.

What is claimed is:
 1. A method, comprising: receiving reflectedradiation pulses with a plurality of single photon avalanche diodes(SPADs) in a region of interest of a time-of-flight (ToF) ranging array;determining an ambient count of ambient light events generated by a SPADcluster of a plurality of SPAD clusters; and gating an output of theSPAD cluster based on the ambient count.
 2. The method of claim 1,further comprising counting events generated by an OR tree coupled tothe SPAD cluster to determine the ambient count.
 3. The method of claim1, wherein the determining the ambient count comprises counting eventsgenerated by the SPAD cluster after stopping illuminating the field ofview of the ToF ranging array.
 4. The method of claim 1, wherein thegating the output of the SPAD cluster comprises gating the output of theSPAD cluster in response to the ambient count being higher than anambient threshold.
 5. The method of claim 1, further comprisingdetermining a signal count of events associated with the reflectedradiation pulses by monitoring events generated by the SPAD cluster,wherein gating the output of the SPAD cluster is further based on thesignal count.
 6. The method of claim 5, further comprising determining asignal to ambient ratio based on the signal count and the ambient count,wherein gating the output of the SPAD cluster comprises gating theoutput of the SPAD cluster in response to the signal to ambient ratiobeing lower than a ratio threshold.
 7. The method of claim 5, furthercomprising determining a confidence value based on the signal count andthe ambient count using the equation, wherein C is the confidence value,S is the signal count, A is the ambient count, and W is a number between0 and 1, inclusive, wherein gating the output of the SPAD clustercomprises gating the output of the SPAD cluster in response to theconfidence value being lower than a confidence threshold.
 8. A rangingcircuit, comprising: a plurality of single photon avalanche diodes(SPAD) configured to receive reflected radiation pulses in a region ofinterest of a time-of-flight (ToF) ranging array; a non-transitorymemory storage comprising instructions; and a processor in communicationwith the non-transitory memory storage, wherein the processor executesthe instructions to: determine an ambient count of ambient light eventsgenerated by a SPAD cluster of a plurality of SPAD clusters; and gate anoutput of the SPAD cluster based on the ambient count.
 9. The rangingcircuit of claim 8, further comprising a plurality of OR trees, whereineach OR tree is coupled to a respective SPAD cluster, the processorexecutes the instructions to count events generated by each respectiveOR tree to determine the ambient count.
 10. The ranging circuit of claim8, wherein the determining the ambient count comprises counting eventsgenerated by the SPAD cluster after stopping illuminating the field ofview of the ToF ranging array.
 11. The ranging circuit of claim 8,wherein the gating the output of the SPAD cluster comprises gating theoutput of the SPAD cluster in response to the ambient count being higherthan an ambient threshold.
 12. The ranging circuit of claim 8, whereinthe processor executes the instructions to determine a signal count ofevents associated with the reflected radiation pulses by monitoringevents generated by the SPAD cluster, wherein gating the output of theSPAD cluster is further based on the signal count.
 13. The rangingcircuit of claim 12, wherein the processor executes the instructions todetermine a signal to ambient ratio based on the signal count and theambient count, wherein gating the output of the SPAD cluster comprisesgating the output of the SPAD cluster in response to the signal toambient ratio being lower than a ratio threshold.
 14. An optical device,comprising: a time-of-flight (ToF) ranging array configured toilluminate a field-of-view (FoV) of the ToF ranging array with radiationpulses; and a ranging circuit, comprising: a plurality of single photonavalanche diodes (SPAD) configured to receive reflected radiation pulsesin a region of interest of the ToF ranging array, a non-transitorymemory storage comprising instructions, and a processor in communicationwith the non-transitory memory storage, wherein the instructions, whenexecuted by the processor, causes the processor to: determine an ambientcount of ambient light events generated by a SPAD cluster of a pluralityof SPAD clusters; and gate an output of the SPAD cluster based on theambient count.
 15. The optical device of claim 14, wherein the rangingcircuit further comprises a plurality of OR trees, wherein each OR treeis coupled to a respective SPAD cluster, the processor executes theinstructions to count events generated by each respective OR tree todetermine the ambient count.
 16. The optical device of claim 14, whereinthe determining the ambient count comprises counting events generated bythe SPAD cluster after stopping illuminating the FoV of the ToF rangingarray.
 17. The optical device of claim 14, wherein the gating the outputof the SPAD cluster comprises gating the output of the SPAD cluster inresponse to the ambient count being higher than an ambient threshold.18. The optical device of claim 14, wherein the processor executes theinstructions to determine a signal count of events associated with thereflected radiation pulses by monitoring events generated by the SPADcluster, and wherein gating the output of the SPAD cluster is furtherbased on the signal count.
 19. The optical device of claim 18, whereinthe processor executes the instructions to determine a signal to ambientratio based on the signal count and the ambient count, wherein gatingthe output of the SPAD cluster comprises gating the output of the SPADcluster in response to the signal to ambient ratio being lower than aratio threshold.
 20. The optical device of claim 18, wherein theprocessor executes the instructions to determine a confidence valuebased on the signal count and the ambient count using the equation${C = \frac{S - {W \cdot \sqrt{S}}}{A}},$ wherein C is the confidencevalue, S is the signal count, A is the ambient count, and W is a numberbetween 0 and 1, inclusive, wherein gating the output of the SPADcluster comprises gating the output of the SPAD cluster in response tothe confidence value being lower than a confidence threshold.